import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooUserRoleController } from '../../../controllers';
const uctoouserRoleRouter = new Router();
const userRoleController = new uctooUserRoleController();

uctoouserRoleRouter.post('/add', requireUser, userRoleController.add);
uctoouserRoleRouter.post('/edit', requireUser, rowLevelPermission('uctoo/user_role'), userRoleController.edit);
uctoouserRoleRouter.post('/del', requireUser, rowLevelPermission('uctoo/user_role'), userRoleController.delete);

//For getting userRole with permission control
uctoouserRoleRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/user_role'), userRoleController.getSingle);
uctoouserRoleRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/user_role'), userRoleController.getMany);
uctoouserRoleRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/user_role'), userRoleController.getMany);

//#endregion AutoCreateCode
export default uctoouserRoleRouter;
